
import request from '@/utils/request'

export function getUserList(page = 1, limit = 1, filterUPN = '') {
  return request({
    url: '/api/user/',
    method: 'get',
    params: { page, limit, filterUPN }
  })
}

export function createUser(data) {
  return request({
    url: '/api/user/',
    method: 'post',
    data
  })
}

export function updateUser(id, data) {
  return request({
    url: '/api/user/' + id + '/',
    method: 'patch',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/api/user/user_info/',
    method: 'get'
    // params: { token }
  })
}

export function getUserCount() {
  return request({
    url: '/api/user/user_count/',
    method: 'get'
  })
}

export function changePass(data) {
  return request({
    url: '/api/user/change_pass/',
    method: 'post',
    data
  })
}

export function getPreDepositCount(data) {
  return request({
    url: '/api/user/user_pre_deposit_count/',
    method: 'get'
  })
}

export function scanUser(data) {
  return request({
    url: '/api/user/scan/',
    method: 'post',
    data: { 'filter_upn': data }
  })
}
